From: Sebastian Keller Date: Tue, 17 Mar 2026 03:21:09 +0000 (+0100) Subject: quickSettings: Consider menu width when calculating its preferred height X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~10^2^2~83 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=8dfb9dbc34dc88b6792026ecce85900d60746304;p=gnome-shell.git quickSettings: Consider menu width when calculating its preferred height Previously the width of a menu was ignored when calculating its preferred height. This was leading to line wrapped text never being wrapped in these calculations and thus the menu being assumed to be shorter than it actually ends up when allocated with line wrapping. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6952 Part-of: --- diff --git a/js/ui/quickSettings.js b/js/ui/quickSettings.js index 8a055e56b..6102ff252 100644 --- a/js/ui/quickSettings.js +++ b/js/ui/quickSettings.js @@ -667,10 +667,11 @@ const QuickSettingsLayout = GObject.registerClass({ return [this.nColumns * childMin + spacing, this.nColumns * childNat + spacing]; } - vfunc_get_preferred_height(container, _forWidth) { + vfunc_get_preferred_height(container, forWidth) { const rows = this._getRows(container); - let [minHeight, natHeight] = this._overlay.get_preferred_height(-1); + let [minHeight, natHeight] = + this._overlay.get_preferred_height(forWidth); const spacing = (rows.length - 1) * this.row_spacing; minHeight += spacing; @@ -688,12 +689,13 @@ const QuickSettingsLayout = GObject.registerClass({ vfunc_allocate(container, box) { const rows = this._getRows(container); - const [, overlayHeight] = this._overlay.get_preferred_height(-1); + const [, overlayHeight] = + this._overlay.get_preferred_height(box.get_width()); const availWidth = box.get_width() - (this.nColumns - 1) * this.column_spacing; const childWidth = Math.floor(availWidth / this.nColumns); - this._overlay.allocate_available_size(0, 0, box.get_width(), box.get_height()); + this._overlay.allocate_available_size(0, 0, box.get_width(), overlayHeight); const isRtl = container.text_direction === Clutter.TextDirection.RTL;